from my_utils import str_util as u
from my_utils import file_util as s

str1 = input("请输入语句1：")
u.str_reverse(str1)
str2 = input("请输入语句2：")
flag = 1
while flag :
    x = (input("请输入数据："))
    y = (input("请输入数据："))
    if x.isdigit() and y.isdigit():
        y, x = int(y), int(x)
        if y >= x and y <= len(str2):
            flag = 0
            u.substr(str1, x, y)
        else:
            print("请确保y大于等于x,且y小于等于字符串的长度-1")
    else:
        print(f"{x}和{y}不全是数字或输入的值过大！请重新输入！")
file = input("请输入文件的路径：")
s.append_to_file(file)
s.print_file_info(file)
